/**
 * Created by justdoit on 15-6-2.
 */
$(document).ready(function(){

    $("#add_article").click(function(){
        var params = {
            id:1
        };
        var data = ajaxQueryHtmlDataByParams(false,"get","http://localhost:8080/springmvc-api/login",params);
        console.log(data);
        /*$("#admin_main").html(data);
        new BaseWindow("添加成功","这里显示自定义的内容",400,100,"draggable","closeTime").showWidow();*/
    });
    $("#list_article").click(function(){
        var data = ajaxQueryDataByParams(false,"get",HttpRequest.article,"");
        console.log(data);
        $("#admin_main").load("../jsp/article/listArticle.jsp",data);
    });
    $("#delete_article").click(function(){
        var params = {
            _method:'delete',
            id:1
        };
        var data = ajaxQueryHtmlDataByParams(false,"post",HttpRequest.article,params);
        console.log(data);
        $("#admin_main").html(data);
    });
    $("#update_article").click(function(){
        var params = {
            _method:'put',
            id:1
        };
        var data = ajaxQueryHtmlDataByParams(false,"post",HttpRequest.article,params);
        console.log(data);
        $("#admin_main").html(data);
    });

    /**
     * bootstrap 警告框关闭事件
     */
    $(".alert").find("button").click(function(){
        $(".alert").addClass("hide");
    });
});